package com.delos.world.controller;

import com.delos.hello.rpc.IHelloRpc;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zouyaowen
 * @date 2020-04
 */
@RestController
@Slf4j
public class WorldController {
    @Reference(retries = 0, check = false)
    private IHelloRpc helloRpc;

    @GetMapping("/world")
    public String world(String name) {
        String helloRes = helloRpc.hello(name);
        log.info("hello方法远程调用返回值=[{}]", helloRes);
        return "world" + name;
    }
}
